export const classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim());
export const hasClass = (el, cls) => {
    if ( !el || !cls)
        return false
    if (cls.includes(' '))
        throw new Error('class不能有空格')
    return el.value.classList.contains(cls)
}
export const addClass = (el, cls) => {
    if ( !el || !cls.trim())
        return
    el.value.classList.add(...classNameToArray(cls))
}
export const removeClass = (el, cls) => {
    if ( !el || !cls.trim())
        return
    el.value.classList.remove(...classNameToArray(cls))
}
